﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using YeaTrip.Framework.Validation;

namespace YeaTrip.Web.Models.Account
{
    public class LoginModel
    {
        /// <summary>
        /// 登录账号
        /// </summary>
        [Required(ErrorMessage="登录账号不能为空")]
        [InputLength(maxLength=128,ErrorMessage="登录账号长度超过限制范围")]
        [RegularExpression(RegExpress.PhoneEmailExpress,ErrorMessage="手机或邮箱格式不正确")]
        public string Account { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        [Required(ErrorMessage="密码不能为空")]
        [InputLength(maxLength=16,ErrorMessage="密码长度超过限制范围")]
        public string Password { get;set; }
        /// <summary>
        /// 验证码
        /// </summary>
        [Required(ErrorMessage="验证码不能为空")]
        [InputLength(maxLength=4,ErrorMessage="验证码长度超过限制范围")]
        public string ValidateCode { get; set; }
        /// <summary>
        /// 登录失败次数(返回)
        /// </summary>
        public int FailedTime { get; set; }
        /// <summary>
        /// 客户昵称(返回)
        /// </summary>
        public string NickName { get; set; }
        /// <summary>
        /// 登录是否成功(返回)
        /// </summary>
        public bool IsSuccess { get; set; }
        /// <summary>
        /// 错误信息(返回)
        /// </summary>
        public string ErrMsg { get; set; }
    }
}